package main;

public class PC {  
	 private CPU cpu;  
	 private HardDisk hardDisk; // 为了代码清晰，我将变量名从HD改为hardDisk  

	 public void setCPU(CPU cpu) {  
	     this.cpu = cpu;  
	 }  

	 public void setHardDisk(HardDisk hardDisk) {  
	     this.hardDisk = hardDisk;  
	 }  

	 public void show() {  
	     System.out.println("CPU Speed: " + cpu.getSpeed() + " MHz");  
	     System.out.println("Hard Disk Capacity: " + hardDisk.getAmount() + " GB");  
	 }  
	}  